//
//  YQLoginViewController.m
//  OverseasImmigration
//
//  Created by yuqin on 2019/5/21.
//  Copyright © 2019年 yuqin. All rights reserved.
//

#import "YQLoginViewController.h"
#import "YQLoginView.h"

@interface YQLoginViewController ()

@end

@implementation YQLoginViewController
{
    __block NSString *_teleText;
    __block NSString *_codeText;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    YQLoginView *loginView = [[YQLoginView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    //发送短信验证码
    loginView.block = ^(NSString *tele, NSString *code) {
        NSString *urlStr = [NSString stringWithFormat:@"%@user/login",BaseHttpUrl];
        [[HTTPRequstManger sharedHTTPRequstManger] postRequestWithUrlString:urlStr appendParameters:nil bodyParameters:@{@"phone":tele,@"code":code} successBlock:^(id responseObject) {
            
        } failureBlock:^(NSError *error) {
            
        }];
    };
    
    @weakify(self);
    [[loginView.quitBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
        @strongify(self);
        [self dismissViewControllerAnimated:YES completion:nil];
    }];
    [self.view addSubview:loginView];
}

@end
